package com.example.demo.web.Controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.context.request.async.DeferredResult;

import com.example.demo.web.services.MissionService;


@Controller
public class LockMissionController {
	
	private MissionService missionService;
    @Autowired
    public void setMissionService(MissionService missionService){
        this.missionService = missionService;
    }
    
    @RequestMapping(value = "/getMissionlist",method = RequestMethod.POST,produces="text/html;charset=UTF-8;")
    public @ResponseBody DeferredResult<String> getMissionlist(@RequestBody String jsonstr,HttpServletRequest request, HttpSession session) throws Exception{
    	DeferredResult<String> deferredResult = new DeferredResult<String>();
    	missionService._getMissionlist(deferredResult,jsonstr,request,session);
    	return deferredResult;
    }
    
    @RequestMapping(value = "/getAllotMissionlist",method = RequestMethod.POST,produces="text/html;charset=UTF-8;")
    public @ResponseBody DeferredResult<String> getAllotMissionlist(@RequestBody String jsonstr,HttpServletRequest request, HttpSession session) throws Exception{
    	DeferredResult<String> deferredResult = new DeferredResult<String>();
    	missionService._getAllotMissionlist(deferredResult,jsonstr,request,session);
    	return deferredResult;
    }
    
    @RequestMapping(value = "/getMultiMissionlist",method = RequestMethod.POST,produces="text/html;charset=UTF-8;")
    public @ResponseBody DeferredResult<String> getMultiMissionlist(@RequestBody String jsonstr,HttpServletRequest request, HttpSession session) throws Exception{
    	DeferredResult<String> deferredResult = new DeferredResult<String>();
    	missionService._getMultiMissionlist(deferredResult,jsonstr,request,session);
    	return deferredResult;
    }
    
    @RequestMapping(value = "/missionadd",method = RequestMethod.POST,produces="text/html;charset=UTF-8;")
    public @ResponseBody DeferredResult<String> missionadd(@RequestBody String jsonstr,HttpServletRequest request, HttpSession session) throws Exception{
    	DeferredResult<String> deferredResult = new DeferredResult<String>();
    	missionService._missionadd(deferredResult,jsonstr,request,session);
    	return deferredResult;
    }
    
    @RequestMapping(value = "/allotmissionadd",method = RequestMethod.POST,produces="text/html;charset=UTF-8;")
    public @ResponseBody DeferredResult<String> allotmissionadd(@RequestBody String jsonstr,HttpServletRequest request, HttpSession session) throws Exception{
    	DeferredResult<String> deferredResult = new DeferredResult<String>();
    	missionService._allotmissionadd(deferredResult,jsonstr,request,session);
    	return deferredResult;
    }
    
    @RequestMapping(value = "/allotmissionedit",method = RequestMethod.POST,produces="text/html;charset=UTF-8;")
    public @ResponseBody DeferredResult<String> allotmissionedit(@RequestBody String jsonstr,HttpServletRequest request, HttpSession session) throws Exception{
    	DeferredResult<String> deferredResult = new DeferredResult<String>();
    	missionService._allotmissionedit(deferredResult,jsonstr,request,session);
    	return deferredResult;
    }
    
    @RequestMapping(value = "/allotmissionstop",method = RequestMethod.POST,produces="text/html;charset=UTF-8;")
    public @ResponseBody DeferredResult<String> allotmissionstop(@RequestBody String jsonstr,HttpServletRequest request, HttpSession session) throws Exception{
    	DeferredResult<String> deferredResult = new DeferredResult<String>();
    	missionService._allotmissionstop(deferredResult,jsonstr,request,session);
    	return deferredResult;
    }
    
    @RequestMapping(value = "/multimissionadd",method = RequestMethod.POST,produces="text/html;charset=UTF-8;")
    public @ResponseBody DeferredResult<String> multimissionadd(@RequestBody String jsonstr,HttpServletRequest request, HttpSession session) throws Exception{
    	DeferredResult<String> deferredResult = new DeferredResult<String>();
    	missionService._multimissionadd(deferredResult,jsonstr,request,session);
    	return deferredResult;
    }
    
    @RequestMapping(value = "/missionstop",method = RequestMethod.POST,produces="text/html;charset=UTF-8;")
    public @ResponseBody DeferredResult<String> missionstop(@RequestBody String jsonstr,HttpServletRequest request, HttpSession session) throws Exception{
    	DeferredResult<String> deferredResult = new DeferredResult<String>();
    	missionService._missionstop(deferredResult,jsonstr,request,session);
    	return deferredResult;
    }
    
    @RequestMapping(value = "/missionedit",method = RequestMethod.POST,produces="text/html;charset=UTF-8;")
    public @ResponseBody DeferredResult<String> missionedit(@RequestBody String jsonstr,HttpServletRequest request, HttpSession session) throws Exception{
    	DeferredResult<String> deferredResult = new DeferredResult<String>();
    	missionService._missionedit(deferredResult,jsonstr,request,session);
    	return deferredResult;
    }
    
    @RequestMapping(value = "/multimissionedit",method = RequestMethod.POST,produces="text/html;charset=UTF-8;")
    public @ResponseBody DeferredResult<String> multimissionedit(@RequestBody String jsonstr,HttpServletRequest request, HttpSession session) throws Exception{
    	DeferredResult<String> deferredResult = new DeferredResult<String>();
    	missionService._multimissionedit(deferredResult,jsonstr,request,session);
    	return deferredResult;
    }
    
    @RequestMapping(value = "/getMissionList_template",method = RequestMethod.POST,produces="text/html;charset=UTF-8;")
    public @ResponseBody DeferredResult<String> getMissionList_template(@RequestBody String jsonstr,HttpServletRequest request, HttpSession session) throws Exception{
    	DeferredResult<String> deferredResult = new DeferredResult<String>();
    	missionService.getMissionList_template(deferredResult,jsonstr,request,session);
    	return deferredResult;
    }
    
    @RequestMapping(value = "/stopmission_multi",method = RequestMethod.POST,produces="text/html;charset=UTF-8;")
    public @ResponseBody DeferredResult<String> stopmission_multi(@RequestBody String jsonstr,HttpServletRequest request, HttpSession session) throws Exception{
    	DeferredResult<String> deferredResult = new DeferredResult<String>();
    	missionService._stopmission_multi(deferredResult,jsonstr,request,session);
    	return deferredResult;
    }
}
